import type { mockPayParams } from '@/types/payment'
import type { videoImage } from '@/types/videoDiagnose'
import { http } from '@/utils/http'

export const createVideoDiagnose = (data: { doctorId: number }) => {
  return http<any>({
    method: 'POST',
    url: '/video_diagnose/createVideoDiagnose',
    data,
  })
}

export const videoMockPay = (data: mockPayParams) => {
  return http<any>({
    method: 'POST',
    url: '/video_diagnose/transactionCallback',
    data,
  })
}

export const getImageByVideoDiagnoseId = (data: { videoDiagnoseId: number }) => {
  return http<videoImage[]>({
    method: 'POST',
    url: '/video_diagnose/searchImageByVideoDiagnoseId',
    data,
  })
}

export const deleteImage = (data: { videoDiagnoseId: number; filename?: string }) => {
  return http<any>({
    method: 'POST',
    url: '/video_diagnose/deleteImage',
    data,
  })
}

export const getRoomId = (data: { doctorId: number }) => {
  return http<string>({
    method: 'POST',
    url: '/video_diagnose/searchRoomId',
    data,
  })
}

export const getUserSig = () => {
  return http<any>({
    method: 'GET',
    url: '/video_diagnose/searchUserSig',
  })
}

export const getVideoOrdersByPage = (data: { page: number; length: number }) => {
  return http<any>({
    method: 'POST',
    url: '/video_diagnose/searchByPage',
    data,
  })
}

export const checkFace = () => {
  return http<String>({
    method: 'GET',
    url: '/video_diagnose/checkFace',
  })
}

export const deleteOrder = (data: { id: number }) => {
  return http<String>({
    method: 'PUT',
    url: '/video_diagnose/deleteById',
    data
  })
}
